package org.dru.clay.respository.artifact;

public class Group implements Comparable<Group> {
	private final String group;

	public Group(String group) {
		this.group = group;
	}

	public String get() {
		return group;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((group == null) ? 0 : group.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Group other = (Group) obj;
		if (group == null) {
			if (other.group != null)
				return false;
		} else if (!group.equals(other.group))
			return false;
		return true;
	}

	@Override
	public int compareTo(Group o) {
		return group.compareToIgnoreCase(o.group);
	}

	@Override
	public String toString() {
		return group;
	}

}
